QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

General Polygons

A general polygon is a closed plane figure defined by one or more lists of vertices. (In other words, a general polygon is a polygon defined by one or more contours.) Each contour may be concave or convex, and contours may be nested. In addition, a general polygon's contours may overlap or be disjoint. All contours, however, must be coplanar. A general polygon can have holes in it; if it does, the even-odd rule is used to determine which parts are inside the polygon. Figure 23 shows a general polygon.

Figure 23 A general polygon

The entire general polygon can have a set of attributes, and any or all of the vertices of any contour can have a set of attributes.

The orientation of a general polygon is determined by the order of the first three noncolinear and noncoincident vertices in the first contour of the general polygon and by the current orientation style of the model containing the polygon. See the chapter "Style Objects" for more information on orientation styles.

A general polygon is defined by the TQ3GeneralPolygonData data type. See "Creating and Editing General Polygons" for a description of the routines you can use to create and edit general polygons.

typedef struct TQ3GeneralPolygonData {
    unsigned long                           numContours;
    TQ3GeneralPolygonContourData            *contours;
    TQ3GeneralPolygonShapeHint              shapeHint;
    TQ3AttributeSet                         generalPolygonAttributeSet;
} TQ3GeneralPolygonData;
numContours
The number of contours in the general polygon. The value of this field must be at least 1.
contours
A pointer to an array of contours that define the general polygon.
shapeHint
A constant that specifies the shape of the general polygon. A general polygon's shape hint may be used by a renderer to optimize drawing the polygon. See "General Polygon Shape Hints" for information about general polygon shape hints.
generalPolygonAttributeSet
A set of attributes for the general polygon. The value in this field is NULL if no general polygon attributes are defined.

The elements of the array of contours pointed to by the contours field are of type TQ3GeneralPolygonContourData , defined as follows:

typedef struct TQ3GeneralPolygonContourData {
    unsigned long                       numVertices;
    TQ3Vertex3D                         *vertices;
} TQ3GeneralPolygonContourData;
numVertices
The number of vertices in the contour. The value of this field must be at least 3.
vertices
A pointer to an array of vertices that define the contour.

© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |

{o{wΩwΩwΩ)J)Jo{o{o{wΩwΩwΩ)J)Jo{o{o{wΩwΩwΩ)J)Jo{o{o{wΩwΩwΩ)J)Jo{o{o{wΩwΩwΩ)J)Jo{o{o{wΩwΩwΩ)J)Jo{o{o{wΩwΩwΩ)J)Jo{o{o{wΩwΩwΩ)J)Jo{o{o{wΩwΩwΩ)J)Jo{o{o{wΩwΩwΩ)J)Jo{o{o{wΩwΩwΩ)J)Jo{o{o{wΩwΩwΩ)J)Jo{o{o{wΩwΩwΩ)J)J{